IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityQueryExtensions Class > GroupBy Method : GroupBy<TSource>(IEntityQuery<TSource>,IProjectionSelector,IProjectionSelector) Method |
'Declaration
<ExtensionAttribute()> Public Overloads Shared Function GroupBy(Of TSource)( _ ByVal source As IEntityQuery(Of TSource), _ ByVal keySelector As IProjectionSelector, _ ByVal elementSelector As IProjectionSelector _ ) As ITypedEntityQuery
'Usage
Dim source As IEntityQuery(Of TSource) Dim keySelector As IProjectionSelector Dim elementSelector As IProjectionSelector Dim value As ITypedEntityQuery value = EntityQueryExtensions.GroupBy(Of TSource)(source, keySelector, elementSelector)
[Extension()] public static ITypedEntityQuery GroupBy<TSource>( IEntityQuery<TSource> source, IProjectionSelector keySelector, IProjectionSelector elementSelector )
var mgr = new DomainModelEntityManager(); var keyPs = new ProjectionSelector("Country"); var elementPs = new ProjectionSelector("CompanyName"); var query = mgr.Customers.GroupBy(keyPs, elementPs); var results = query.Execute(); var r0List = results.Cast<IGrouping<String, String>>().ToList();
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2